//
//  UIView+PopupProtocol.h
//  NewiOSProject
//
//  Created by li on 2023/9/6.
//  Copyright © 2023 范智渊. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "PopupTranslucentView.h"
NS_ASSUME_NONNULL_BEGIN

typedef enum : NSUInteger {
    PopupViewModalStyleFromBottom,
    PopupViewModalStyleFromLeft,
    PopupViewModalStyleFromRight,
    PopupViewModalStyleFromTop,
    PopupViewModalStyleCenterScale,
} PopupViewModalStyle;

@protocol PopupProtocol <NSObject>
@property(nonatomic, strong, nonnull) UIView *translucentView;
@property(nonatomic, assign) PopupViewModalStyle modalStyle;
@property(nonatomic, copy) void(^dismissCompletion)(void);

@end

NS_ASSUME_NONNULL_END

NS_ASSUME_NONNULL_BEGIN

@interface UIView (PopupProtocol)<PopupProtocol>


- (void)show:(BOOL)toggle target:(UIView *)rootView edgeInsets:(UIEdgeInsets)edgeInsets;
- (void)popup:(UIView *)rootView edgeInsets: (UIEdgeInsets)edgeInsets ;
- (void)dismissPopup;
- (UIView *)defaultTranslucentView;
- (void)addTapGestuer: (void(^)(UIView *view))action;

- (UIView *)then: (void(^)(UIView *view))configure;
@end

NS_ASSUME_NONNULL_END
